import AllLayout from "./views/router"
import { useSelector, useDispatch } from 'react-redux';
import { useEffect } from 'react'
import { getUserInfoAsync } from './rtk/modules/data';
function App() {
  const userInfo = useSelector((state: any) => state.data.userInfo)
  const dispatch: any = useDispatch()
  useEffect(() => {
    if (!userInfo) {
      dispatch(getUserInfoAsync({ id: 123 }))
    }
  }, [dispatch])



  return (
    <div className="root">
      <AllLayout />
    </div>
  )
}

export default App
